<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>


<script type="text/javascript" src="js/jquery.itextclear.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $('input[type=text], input[type=password], input[type=url], input[type=email], input[type=number], textarea', '.form').iTextClear();
    });
</script>
<!-- jQplot CSS -->

<link rel="stylesheet" media="screen" href="css/Tree.css" />
<!-- jQplot CSS END -->

<!-- DATATABLES CSS -->
<link rel="stylesheet" media="screen" href="lib/datatables/css/vpad.css" />
<script type="text/javascript" src="lib/datatables/js/jquery.dataTables.js"></script>

<h1 class="page-title">薪资福利管理统计</h1>


<div class="container_12 clearfix leading">
    <section class="tabs grid_12 leading">
        <ul class="clearfix">
            <li><a href="#" class="current">${topOrganizationName}</a></li>
        </ul>
        <section>
            <section class="clearfix" style="display: block;">
                <header class="grid_12 alpha omega">
                    <p>
                        <span>年月： </span>
                        <select id="search_year">
                            <s:iterator begin="#request.startYear" end="#request.endYear" var="y">
                                <option value="${y}" ${y==year?"selected='selected'":""}>${y}年</option>
                            </s:iterator>
                        </select>
                        <select id="search_month">
                            <s:iterator begin="1" end="12" var="m">
                                <option value="${m}" ${m==month?"selected='selected'":""}>${m}月</option>
                            </s:iterator>
                        </select>
                        <span>
		                    <input type="button" onclick="javascript:search()" value="点击搜索">
						</span>
                    </p>
                </header>
                <div id="demo" class="clearfix">

                    <table class="display" id="example">
                        <thead>
                        <tr>
                            <th>全选
                                <input type="checkbox" id="form-updates6" value="1" onchange="checkAll(this,'check_salary_sta')"/></th>
                            <th>员工工号</th>
                            <th>姓名</th>
                            <th>部门</th>
                            <th>职务</th>
                            <th>薪资项目</th>
                            <th>合计</th>
                        </tr>
                        </thead>
                        <tbody>
                        <s:if test="#request.salaryStatisticses==null || #request.salaryStatisticses.size==0">
                            <tr class="gradeX">
                                <td colspan="7">暂无相关数据</td>
                            </tr>
                        </s:if>
                        <s:else>

                            <s:iterator value="#request.salaryStatisticses" status="sta" var="s">
                                <s:set name="total" value="#s.id"></s:set>
                                <s:if test="#sta.even">
                                    <tr class="gradeA">
                                </s:if><s:else><tr class="gradeC"></s:else>
                                <td><input type="checkbox" id="check_salary_sta" name="check_salary_sta" value="${s.id}"/></td>
                                <td><a href="#employee/staff_view.xhtml?id=${s.employeeinfoWork.id}">${s.employeeinfoWork.workNo}</a></td>
                                <td>${s.employeeinfoWork.baseId.name}</td>
                                <td>${s.employeeinfoWork.organization.fullName}</td>
                                <td>${s.employeeinfoWork.duty.dutyName}</td>
                                <td><s:if test="#s.details==null || #s.details.size<=0">
                                    暂无
                                </s:if>
                                    <s:else>
                                        <s:iterator value="#s.details" var="detail">
                                            <a class="button" href="javascript://">
                                                <s:if test="#detail.structType.toString().equals('subsidy')"><span style="background:url(${ctx}/images/img/add.png)" class="icon">&nbsp;</span></s:if>
                                                <s:else><span style="background:url(${ctx}/images/img/delete.png)" class="icon">&nbsp;</span></s:else>${detail.schemeTitle}:${detail.schemeSalary}</a>
                                        </s:iterator>
                                    </s:else>
                                </td>
                                <td>${s.actaulPaySalary}</td>
                                </tr>
                            </s:iterator>

                        </s:else>
                        </tbody>
                    </table>
                </div>
            </section>
        </section>
    </section>
</div>

<div class="clear"></div>


<script type="text/javascript" src="js/Tree.js"></script>
<!-- POPOVER SETUP--><script type="text/javascript" src="js/Tree.js"></script>

<script type="text/javascript">
    $(function(){
        setTimeout("init()", 800)
    });
    function init(){
        $("#search_year").val("${year}");
        $("#search_month").val("${month}");
    }
    function search(){
        window.location.href = "#public/salary_person_statistics.xhtml?year="+$("#search_year").val()+"&month="+$("#search_month").val();
    }
</script>
